const express = require('express')
const app = express()
const port = 3021

//引入路由文件
const router = require('./router.js')

const bodyParser = require('body-parser')

//开启静态文件
app.use('/www',express.static('public'));

app.use(bodyParser.urlencoded({extended:false}));
app.use(bodyParser.json());

app.use(router)

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => {
	console.log(`running.......... on port ${port}!`)
})